/**
 * Created by user on 2016/11/24.
 */

import React from 'react'
import { Tabs, Form, Input, Button, Select, Breadcrumb } from 'antd';
import Handled from './handled';
import Unhandle from './unHandle';

  const TabPane = Tabs.TabPane

  /* 放款管理页面 */


  let LoanManagementList = React.createClass({

    contextTypes: {
      router: React.PropTypes.object
    },

    getInitialState() {
      return {
        data: [],
        authorBtn: [],
        item: '放款管理',
        lastPath: '',
        activeKey: '1',

      }
    },
    handleRouter() {
      let path = this.props.location.pathname;
      let lastPath = path.split('/')[path.split('/').length - 1];
      let index = '/financialSupport/loanManagement/list';
      let goPathUrl = (lastPath == 'list') ? model : index;

      this.setState({
        lastPath: lastPath
      });
      this.context.router.push(goPathUrl);
    },

    handleTabChange (key) {
      this.setState({
        activeKey: key
      })
    },

    render() {


      const unhandleProps = {
        tabType: this.state.activeKey
      }
      const handledProps = {
        tabType: this.state.activeKey
      }


      let path = this.props.location.pathname;
      console.log(path)
      let lastPath = path.split('/')[path.split('/').length - 1];
      let routerItem = {
        'list': '列表',
        'model': '审批',
      };
      return (
        <div >
          <div style={{ padding: '10px' }}>
              <Breadcrumb separator="-">
                <Breadcrumb.Item>放款管理</Breadcrumb.Item>
              </Breadcrumb>
          </div>
            <Tabs type="card" onChange={this.handleTabChange} style={{marginLeft: '10px'}}>
              <TabPane tab="未处理" key="1">
                <Unhandle {...unhandleProps}/>
              </TabPane>
              <TabPane tab="已处理" key="2">
               <Handled {...handledProps}/>
              </TabPane>
            </Tabs>
        </div>
      )
    }
  })
export default
LoanManagementList